<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> {$setting.webname}- 单页管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/public/static/favicon.ico"> <link href="/public/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-sm-4">
            <h2>单页管理</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="{:url('Admins/admin')}">主页</a>
                </li>
                <li>
                    <strong>单页列表</strong>
                </li>
            </ol>
        </div>
        <div class="col-sm-8" style="text-align: right;line-height: 15px;margin-top:25px;">
            <small><i class="fa fa-circle" style="color:#f05151"></i>置顶<br/><i class="fa fa-circle" style="color:#f8ac5a"></i>最新<br/><i class="fa fa-circle" style="color:#28c24d"></i>普通</small>
        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeIn">
        <div class="row">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs" id="table-title">
                        {foreach $list as $v}
                            <li id="type{$v.id}" data-id="{$v.id}"><a data-toggle="tab" href="#tab-{$v.id}"  aria-expanded="true"> {$v.page_name}</a></li>
                        {/foreach}
                    </ul>
                    <div class="tab-content">
                        {foreach $list as $v}
                        <!--新闻列表开始-->
                        <div id="tab-{$v.id}" class="tab-pane">
                            <div class="panel-body">
                                {if condition="empty($v.newslist)"}
                                暂无数据
                                {/if}
                                {foreach $v.newslist as $vs}
                                <!--行开始-->
                                    <div class="forum-item">
                                        <div class="row">
                                            <!--左边部分-->
                                            <div class="col-sm-10">
                                                {if condition="!empty($vs.cover)"}
                                                <div class="row">
                                                <!--用户头像及名称-->
                                                    <div class="col-sm-2" style="text-align: center">
                                                        <img src="{$vs.cover}" style="width:100%;display: block;margin:0 auto"/>
                                                    </div>
                                                    <div class="col-sm-10">
                                                        <!--文章标题-文章操作-->
                                                        <div style="font-size:18px;font-weight:bold"  class="forum-item-title">
                                                            {switch name="$vs.sorttype" }
                                                                {case value="1" }<i class="fa fa-circle" style="color:#f05151"></i>{/case}
                                                                {case value="2" }<i class="fa fa-circle" style="color:#f8ac5a"></i>{/case}
                                                                {case value="3" }<i class="fa fa-circle" style="color:#28c24d"></i>{/case}
                                                            {/switch}&nbsp;
                                                            {$vs.title}&nbsp;&nbsp;<a href="{:url('Pages/update')}?id={$vs.id}"><i class="glyphicon glyphicon-pencil" style="color:#24b7e5;font-size:12px;"></i></a>&nbsp;&nbsp;<a class="del" data-id="{$vs.id}" data-typeid="{$v.id}"><i class="glyphicon glyphicon-trash" style="color:#24b7e5;font-size:12px;"></i></a></div>
                                                        <div><span title="发布时间" style="cursor:pointer">{$vs.create_time}</span><strong> | </strong><span title="修改时间"  style="cursor:pointer">{$vs.update_time}</span></div>
                                                        <!--文章描述-->
                                                        <div style=" white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">描述：{$vs.desc}</div>
                                                        <!--关键词-->
                                                        <div>关键词：{foreach $vs.key as $vvk=>$vvs}<span class="badge badge-primary">{$vvs}</span> {/foreach}</div>


                                                    </div>
                                                </div>
                                                {else /}
                                                <div class="row">
                                                    <!--用户头像及名称-->
                                                    <div class="col-sm-12">
                                                        <!--文章标题-文章操作-->
                                                        <div style="font-size:18px;font-weight:bold"  class="forum-item-title">
                                                            {switch name="$vs.sorttype" }
                                                            {case value="1" }<i class="fa fa-circle" style="color:#f05151"></i>{/case}
                                                            {case value="2" }<i class="fa fa-circle" style="color:#f8ac5a"></i>{/case}
                                                            {case value="3" }<i class="fa fa-circle" style="color:#28c24d"></i>{/case}
                                                            {/switch}&nbsp;
                                                            {$vs.title}&nbsp;&nbsp;<a href="{:url('Pages/update')}?id={$vs.id}"><i class="glyphicon glyphicon-pencil" style="color:#24b7e5;font-size:12px;"></i></a>&nbsp;&nbsp;<a class="del" data-id="{$vs.id}" data-typeid="{$v.id}"><i class="glyphicon glyphicon-trash" style="color:#24b7e5;font-size:12px;"></i></a></div>
                                                        <div><span title="发布时间" style="cursor:pointer">{$vs.create_time}</span><strong> | </strong><span title="修改时间"  style="cursor:pointer">{$vs.update_time}</span></div>
                                                        <!--文章描述-->
                                                        <div>描述：{if condition="strlen($vs.desc) > 100"}{$vs.desc|mb_substr=0,100,'utf-8'}……{else /} {$vs.desc} {/if}</div>

                                                        <div></div>
                                                        <!--关键词-->
                                                        <div>关键词：{foreach $vs.key as $vvk=>$vvs}<span class="badge badge-primary">{$vvs}</span> {/foreach}</div>
                                                    </div>
                                                </div>
                                                {/if}
                                            </div>
                                            <!--浏览量-->
                                            <div class="col-sm-1 forum-info">
                                            <span class="views-number">
                                                {$vs.hits}
                                            </span>
                                                <div>
                                                    <small>浏览量</small>
                                                </div>
                                            </div>
                                            <!--作者-->
                                            <div class="col-sm-1 forum-info">
                                            <span class="views-number">
                                                <img src="/public/static/admin/uploads/headphoto/{$vs.photo}" style="width: 40px;display: block;margin:0 auto;border-radius: 50%;"/>
                                            </span>
                                                <div>
                                                    <small>{$vs.author}</small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <!--行结束-->
                                {/foreach}
                                {$v['newslist']->render()}
                            </div>
                        </div>
                        <!-- 新闻列表结束 -->
                        {/foreach}
                    </div>
                </div>
            </div>
        </div>
       
    </div>


    <!-- 全局js -->
    <script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/public/static/admin/js/bootstrap.min.js?v=3.3.6"></script>



    <!-- 自定义js -->
    <script src="/public/static/admin/js/content.js?v=1.0.0"></script>
    <script src="/public/static/admin/layui/layui.js"></script>
    <script>
        $("#type{$activeid}").attr("class","active");
        $("#tab-{$activeid}").attr("class","tab-pane active");
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            //点击提交
            $(".del").click(function(){
                var s = $(this);
                top.layer.msg('你确定要删除？', {
                    time: 20000, //20s后自动关闭
                    shade: 0.8,
                    btn: ['确定', '取消'],
                    btn1:function(){
                        $.post("{:url('Pages/deletes')}",{id:s.attr('data-id'),typeid:s.attr('data-typeid')},function(data){
                            top.layer.closeAll();
                            top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                                if(data.url){
                                    window.location.href = data.url;
                                }
                            });
                        });
                    }
                });

            });
        });
    </script>

    
    

</body>

</html>
